<template>
    <div class="about">

    <h1>创建分类</h1>

    <el-form label-width="120px" @submit.native.prevent="save">
        <el-form-item label="名称">
            <el-input v-model="model.name"></el-input>
        </el-form-item>
        <el-form-item>
            <el-button type="primary" native-type="submit">保存</el-button>
        </el-form-item>
    </el-form>
    </div>
</template>

<script>
    import axios from "axios";

    export default {
        // created() {
        //     let _this = this
        //     axios.post('http://localhost:8081/helloword',_this.model)
        // },
       data(){
           return{
               model:{
                   id: 7,
                   name: 'name',
                   icon: 'http:127.0.0.1',
                   status: 0

               }
           }
       },
        methods:{
           save(){
               // axios.get('http://localhost:8081/helloword/123')

               axios.post('http://localhost:8081/add',this.model)
           }
        },
    }
</script>

<style scoped>

</style>